<!DOCTYPE html>
<!-- 219970720刘莹 -->
<html>
	<head>
		<meta charset="utf-8">
		<title>打印任意数的图形</title>
	</head>
	<script>
		
				var i,j,z;
				var num1,num2,num3;
				num1=prompt("三角形的输入数字打印行数\n");
				for(i=1;i<=num1;i++)/* 三角形 */
					{
						for(j=1;j<=num1-i;j++)
							document.write("&nbsp;&nbsp");
						for(j=1;j<=i;j++)
							document.write("&nbsp*&nbsp");
						document.write("<br/>");
					}
				num2=prompt("平行四边形的输入数字打印行数\n");
				for(i=1;i<=num2;i++)/*平行四边形*/
					{
						for(j=1;j<=num2-i;j++)
							document.write("&nbsp;&nbsp");
						for(j=1;j<=num2;j++)
							document.write("&nbsp*&nbsp");
						document.write("<br/>");
					}
				num3=prompt("菱形的输入数字打印行数\n");	
				for(i=1;i<=(num3/2+1);i++)/*菱形*/
				{
					for(j=1;j<=(num3/2+1)-i;j++)
						document.write("&nbsp;&nbsp;&nbsp");
					for(j=1;j<=2*i-1;j++)
						document.write("&nbsp*&nbsp");
					document.write("<br/>");
				}
				for(i=1;i<=num3/2;i++)
				{
					for(j=1;j<=i;j++)
						document.write("&nbsp;&nbsp;&nbsp");
					for(j=1;j<=num3-2*i;j++)
						document.write("&nbsp*&nbsp");	
					document.write("<br/>");
				}
			</script>
	<body>
	</body>
<ml>
<!-- 
 "use strict:function"
 -->